<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>01-行内样式</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            background-color: skyblue;
        }
    </style>
</head>
<body>
    <div></div>
    <script>
        /* 
            单击div 修改宽度 和背景颜色
            div.style 也是一个对象(对象就是有键值对)
            修改行内样式，用style
        */
       let div = document.querySelector('div');
       div.onclick = function(){
        //    console.log(div.style);
        //    console.log(typeof div.style);    // object
           div.style.width = '300px';
           div.style.backgroundColor = 'purple';
       }
    </script>
</body>
</html>